package cn.sccdlg.maven.controller;

import cn.sccdlg.maven.domain.Item;
import cn.sccdlg.maven.service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author RaoShuang
 * @emil 991207823@qq.com
 * @date 2020/10/25 22:35:28
 * 商品Controller层
 */
@Controller
@RequestMapping("/item")
public class ItemController {

    @Autowired
    private ItemService itemsService;

    /**
     * 查询办件详情信息
     * @param model 数据模型
     * @return
     */
    @RequestMapping("/findDetail")
    public String findDetail(Model model){
        Item item = itemsService.findById(1);
        model.addAttribute("item", item);
        return "itemDetail";
    }
}
